#!/usr/bin/env node

const https = require('https'),
      log = console.log;
let city = process.argv[2]||'石家庄';
let webUrl = 'https://api.66mz8.com/api/weather.php?location=' + city;
https.get(webUrl,(res) => {
  let result = '';
  res.on('data',(data)=>{
    result += data.toString('utf8');
    log(result);
  })
  res.on('end',()=>{
    let weather = JSON.parse(result);
    console.log(weather);
  })
})

